package com.jic.market.service;

import com.jic.common.base.vo.PageResult;
import com.jic.market.entity.PromotionSingleRuleEntity;
import com.jic.market.request.PromotionLimitRuleRequest;
import com.jic.market.request.PromotionProductQueryListRequest;
import com.jic.market.request.PromotionProductSaveBatchListRequest;
import com.jic.market.request.manager.single.PromotionSingleCopyRequest;
import com.jic.common.base.vo.RestResult;
import com.jic.market.response.PromotionProductResponse;

import java.util.List;

/**
 * description: 单一促销规则service
 * date: 2020/3/11 19:24
 * author: zxl
 * version: 1.0
 */
public interface PromotionSingleLimitRuleService {

    void updatePriceOrLimit(PromotionLimitRuleRequest ruleRequest);

    void delete(List<Long> ids);

    /**
     * 添加单一促销限制项目
     * @param PromotionSingleLimitRule
     * @return
     */
    Integer addPromotionSingleLimitRule(PromotionSingleRuleEntity PromotionSingleLimitRule);

    /**
     * 根据 促销id 和 商品id 查询
     * @param promotionId
     * @param mpId
     * @return
     */
    PromotionSingleRuleEntity getEntityByPromotionIdAndMpId(Long promotionId, Long mpId);

    /**
     * 根据 促销id 和 商品id 软删除
     * @param promotionId
     * @param productId
     * @return
     */
    Integer deleteEntityByPromotionIdAndMpId(Long promotionId, Long productId);


    /**
     * 复制
     * @param request
     * @return 新的promotionId
     */
    RestResult<Long> copy(PromotionSingleCopyRequest request);

    /**
     * 保存为模板
     * @param request
     * @return
     */
    RestResult<Long> saveTemplate(PromotionSingleCopyRequest request);


    RestResult deletePromotionSingle(Long promotionId);

    PageResult<PromotionProductResponse> getPromotionProductList(PromotionProductQueryListRequest ppqlRequest);


    Integer saveSingleMerchantProduct(PromotionProductSaveBatchListRequest request);

    Long insertLimit(PromotionLimitRuleRequest ruleRequest);
}
